﻿namespace Microsoft.AspNetCore.App
{
    public interface IWebHostEnvironment
    {
        string EnvironmentName { get; }
    }

    public class WebHostEnvironment : IWebHostEnvironment
    {
        public WebHostEnvironment(string environmentName)
        {
            EnvironmentName = environmentName;
        }

        public string EnvironmentName { get; }
    }

    public static class IWebHostEnvironmentExtensions
    {
        public static bool IsDevelopment(this IWebHostEnvironment environment)
        {
            return environment.EnvironmentName == "Development";
        }
    }
}
